# -*- coding: UTF-8 -*-    
# Author:yangshuoshuo
# FileName:datetime模块
# DateTime:2024/7/14 15:44
# SoftWare: PyCharm
from datetime import datetime
print(datetime.now(), type(datetime.now()))

current_datetime = datetime.now()
date = current_datetime.strftime("%Y/%m/%d %H-%M-%S")
print(date, type(date))

date1 = "2024-10-10 10:15:40"
datetime1 = datetime.strptime(date1, "%Y-%m-%d %H:%M:%S")
print(datetime1)

date1 = "2024/10/10 10:15:40"
datetime1 = datetime.strptime(date1, "%Y/%m/%d %H:%M:%S")
print(datetime1)

date1 = "2024年10月10日 10:15:40"
datetime1 = datetime.strptime(date1, "%Y年%m月%d日 %H:%M:%S")
print(datetime1)


